/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.spreedairy.portal.model.impl;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import com.spreedairy.portal.model.CustomFieldValue;

import java.io.Serializable;

/**
 * The cache model class for representing CustomFieldValue in entity cache.
 *
 * @author SpreeDairy
 * @see CustomFieldValue
 * @generated
 */
public class CustomFieldValueCacheModel implements CacheModel<CustomFieldValue>,
	Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(9);

		sb.append("{recId=");
		sb.append(recId);
		sb.append(", itemId=");
		sb.append(itemId);
		sb.append(", keyName=");
		sb.append(keyName);
		sb.append(", keyValue=");
		sb.append(keyValue);
		sb.append("}");

		return sb.toString();
	}

	public CustomFieldValue toEntityModel() {
		CustomFieldValueImpl customFieldValueImpl = new CustomFieldValueImpl();

		customFieldValueImpl.setRecId(recId);
		customFieldValueImpl.setItemId(itemId);

		if (keyName == null) {
			customFieldValueImpl.setKeyName(StringPool.BLANK);
		}
		else {
			customFieldValueImpl.setKeyName(keyName);
		}

		if (keyValue == null) {
			customFieldValueImpl.setKeyValue(StringPool.BLANK);
		}
		else {
			customFieldValueImpl.setKeyValue(keyValue);
		}

		customFieldValueImpl.resetOriginalValues();

		return customFieldValueImpl;
	}

	public long recId;
	public long itemId;
	public String keyName;
	public String keyValue;
}